import { defineStore } from 'pinia'

export const headerStore = defineStore('header', {
  state: () => {
    return {
      iscol: false,
      lang: 'zh'
    }
  },
  actions: {
    changeiscol() {
      this.iscol = !this.iscol
    },
    changelang(lang: string) {
      this.lang = lang
    }
  },
  persist: {
    enabled: true,
    strategies: [
      {
        key: 'header',
        storage: localStorage
      }
    ]
  }
})
